@using System.Globalization
@model AccountModel

@{
    ResFile = "cms_Account";
    Layout = "~/admin/Templates/LoginAdministration.cshtml";
    ViewBag.Title = _("Log on");    
}

@using (Html.BeginForm()) {
@Html.AntiForgeryToken(CmsAccountController.LogonSalt)
<fieldset class="b-form b-form_login">
	<h2>@_("Login")</h2>
	<p class="b-form_text">@_("Enter your details to access your Administration Site.")</p>
	@Html.ValidationSummary()	
	<ol class="b-form__rows ul-reset g-clear">
		<li class="b-form__row g-clear">
            @Html.ValidationMessageFor(p => p.UserName)
			@Html.LabelFor(p => p.UserName)
            @Html.TextBoxFor(p => p.UserName, new { @class = "text" })
            <div class="hide">
                <!-- this is honeypot, hello bot! -->
                @Html.TextBoxFor(p => p.User)
                <input type="hidden" value="@Model.TimeStamp" name="TimeStamp" id="TimeStamp" />
            </div> 
		</li>
		<li class="b-form__row g-clear">
            @Html.ValidationMessageFor(p => p.Password)
			@Html.LabelFor(p => p.Password)
			@Html.PasswordFor(p => p.Password, new { @class = "text" })
		</li>
	    <li class="b-form__row b-form__row_checkbox g-clear">
	        @Html.CheckBoxFor(m => m.RememberMe, new { @class = "b-checkbox" })
	        <label class="inline" for="RememberMe">@_("Remember Me")</label>
	    </li>
        @if (Model.Languages.Any())
        {
            <li class="b-form__row g-clear">
                <label for="language">@_("Language")</label>
                @Html.DropDownList("Locale", new SelectList(Model.Languages, "Value", "Text", CultureInfo.CurrentUICulture.Name), new { onchange = "document.location.href = '/admin/account/logon?no=true&locale='+this.options[this.selectedIndex].value" })
            </li>
        }
		<li class="b-form__row">
			<input class="b-button" id="btnLogin" name="btnLogin" type="submit" value="@_("Login")" />
		</li>
		<li class="hide">
        	<input id="btn" name="btn" type="submit" value="I'm bot" />
		</li>
	</ol>
</fieldset>
}    

